<script setup>
import { reactive } from "vue"
import {delListsApi,qnameListsApi} from "../util/request"

const data = reactive({
    name: "",    
})

async function del(dalid) {

    /*与下方的写法意义一致
    
    const promise = qnameListsApi(dalid).then(res => {        
        return res
    })
    let p = await promise
    console.log(p);
    
    */

    let p =await qnameListsApi(dalid).then(res => {        
        return res
    })
    
    delListsApi(p[0]).then(res => {
            
    })
}

</script>

<template>
    <van-cell-group inset>
        <van-field v-model="data.name" label="name删除" type="text" />
    </van-cell-group>

    <van-button type="primary" @click="del(data)">删除</van-button>
</template>

<style>

</style>
